import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.JFrame;
import javax.swing.JSlider;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.AbstractAction;
import java.awt.event.ActionEvent;
import javax.swing.Action;


public class AdjustmentWindow extends JFrame {
	private static final long serialVersionUID = 1L;

	private JTextField brightText;

	private JSlider brightSlider;

	private JTextField contrastText;

	private JSlider contrastSlider;

	private JButton zapisz;

	private JButton btnAnuluj;

	public AdjustmentWindow() {
		this.setBounds(50, 50, 500, 270);
		getContentPane().setLayout(null);
		
		setBrightSlider(new JSlider());
		getBrightSlider().setSnapToTicks(true);
		getBrightSlider().setPaintTicks(true);
		getBrightSlider().setMinorTickSpacing(1);
		getBrightSlider().setValue(0);
		getBrightSlider().setMinimum(-255);
		getBrightSlider().setMaximum(255);
		getBrightSlider().setBounds(10, 53, 458, 30);
		getContentPane().add(getBrightSlider());
		
		setContrastSlider(new JSlider());
		getContrastSlider().setSnapToTicks(true);
		getContrastSlider().setPaintTicks(true);
		getContrastSlider().setMinorTickSpacing(1);
		getContrastSlider().setValue(100);
		getContrastSlider().setMinimum(0);
		getContrastSlider().setMaximum(200);
		getContrastSlider().setBounds(10, 120, 458, 35);
		getContentPane().add(getContrastSlider());
		
		JLabel lblJasno = new JLabel("Jasno\u015B\u0107");
		lblJasno.setHorizontalAlignment(SwingConstants.CENTER);
		lblJasno.setToolTipText("Jasno\u015B\u0107");
		lblJasno.setBounds(10, 33, 458, 14);
		getContentPane().add(lblJasno);
		
		JLabel lblContr = new JLabel("Kontrast");
		lblContr.setHorizontalAlignment(SwingConstants.CENTER);
		lblContr.setToolTipText("Kontrast");
		lblContr.setBounds(209, 98, 67, 22);
		getContentPane().add(lblContr);
		
		setBrightText(new JTextField());
		getBrightText().setBounds(285, 30, 44, 20);
		getContentPane().add(getBrightText());
		getBrightText().setColumns(10);
		getBrightText().setText(Integer.toString(getBrightSlider().getValue()));
		
		setContrastText(new JTextField());
		getContrastText().setBounds(285, 99, 44, 21);
		getContentPane().add(getContrastText());
		getContrastText().setColumns(10);
		getContrastText().setText(Double.toString((double)getContrastSlider().getValue()/100));
		
		setZapisz(new JButton("Zapisz"));
		getZapisz().setActionCommand("zapisz");
		getZapisz().setBounds(131, 185, 89, 23);
		getContentPane().add(getZapisz());
		
		setBtnAnuluj(new JButton("Anuluj"));
		getBtnAnuluj().setBounds(240, 185, 89, 23);
		getContentPane().add(getBtnAnuluj());
		
	}


	private void setContrastSlider(JSlider jSlider) {
		this.contrastSlider = jSlider;
	}


	public void setBrightSlider(JSlider brightSlider) {
		this.brightSlider = brightSlider;
	}


	public JSlider getBrightSlider() {
		return brightSlider;
	}
	

	public JSlider getContrastSlider() {
		return contrastSlider;
	}

	public void setBrightText(JTextField brightText) {
		this.brightText = brightText;
	}
	
	public void setContrastText(JTextField contrastText) {
		this.contrastText = contrastText;
	}

	public JTextField getBrightText() {
		return brightText;
	}
	
	public JTextField getContrastText() {
		return contrastText;
	}

	/**
	 * @param zapisz
	 * @uml.property  name="zapisz"
	 */
	public void setZapisz(JButton zapisz) {
		this.zapisz = zapisz;
	}

	/**
	 * @return
	 * @uml.property  name="zapisz"
	 */
	public JButton getZapisz() {
		return zapisz;
	}

	/**
	 * @param btnAnuluj
	 * @uml.property  name="btnAnuluj"
	 */
	public void setBtnAnuluj(JButton btnAnuluj) {
		this.btnAnuluj = btnAnuluj;
	}

	/**
	 * @return
	 * @uml.property  name="btnAnuluj"
	 */
	public JButton getBtnAnuluj() {
		return btnAnuluj;
	}
}
